\doxysection{C\+:/\+Users/\+ASUS/\+Desktop/dm-\/ctrl\+H7-\/balance-\/9025test/bsp/pwm/bsp\+\_\+pwm.h File Reference}
\hypertarget{bsp__pwm_8h}{}\label{bsp__pwm_8h}\index{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/bsp/pwm/bsp\_pwm.h@{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/bsp/pwm/bsp\_pwm.h}}
{\ttfamily \#include "{}tim.\+h"{}}\newline
{\ttfamily \#include "{}stdint.\+h"{}}\newline
{\ttfamily \#include "{}stm32h7xx\+\_\+hal\+\_\+rcc.\+h"{}}\newline
{\ttfamily \#include "{}stm32h723xx.\+h"{}}\newline
\doxysubsubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structpwm__ins__temp}{pwm\+\_\+ins\+\_\+temp}}
\item 
struct \mbox{\hyperlink{struct_p_w_m___init___config__s}{PWM\+\_\+\+Init\+\_\+\+Config\+\_\+s}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{bsp__pwm_8h_a98b3ade23d4246ff52b29c99d2e80643}\label{bsp__pwm_8h_a98b3ade23d4246ff52b29c99d2e80643} 
\#define {\bfseries PWM\+\_\+\+DEVICE\+\_\+\+CNT}~16
\end{DoxyCompactItemize}
\doxysubsubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{bsp__pwm_8h_ad1770b62de4b3cead73c1dffd33aed94}\label{bsp__pwm_8h_ad1770b62de4b3cead73c1dffd33aed94} 
typedef struct \mbox{\hyperlink{structpwm__ins__temp}{pwm\+\_\+ins\+\_\+temp}} {\bfseries PWMInstance}
\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{structpwm__ins__temp}{PWMInstance}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{bsp__pwm_8h_a2120d2df21cbc0f5ce613cc894656623}{PWMRegister}} (\mbox{\hyperlink{struct_p_w_m___init___config__s}{PWM\+\_\+\+Init\+\_\+\+Config\+\_\+s}} \texorpdfstring{$\ast$}{*}config)
\begin{DoxyCompactList}\small\item\em 注册一个pwm实例 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{bsp__pwm_8h_acd81680ae1e7064b568493eb50d0c6d2}{PWMStart}} (\mbox{\hyperlink{structpwm__ins__temp}{PWMInstance}} \texorpdfstring{$\ast$}{*}pwm)
\begin{DoxyCompactList}\small\item\em 启动pwm \end{DoxyCompactList}\item 
void \mbox{\hyperlink{bsp__pwm_8h_a1b6f35949a04703824318426cf726fe3}{PWMSet\+Duty\+Ratio}} (\mbox{\hyperlink{structpwm__ins__temp}{PWMInstance}} \texorpdfstring{$\ast$}{*}pwm, float dutyratio)
\begin{DoxyCompactList}\small\item\em 设置pwm占空比 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{bsp__pwm_8h_a0424e2983ba296a8acfa3a79bbad04a0}{PWMStop}} (\mbox{\hyperlink{structpwm__ins__temp}{PWMInstance}} \texorpdfstring{$\ast$}{*}pwm)
\begin{DoxyCompactList}\small\item\em 停止pwm \end{DoxyCompactList}\item 
void \mbox{\hyperlink{bsp__pwm_8h_a873e5ee427c6c73ce3c444daf26ac769}{PWMSet\+Period}} (\mbox{\hyperlink{structpwm__ins__temp}{PWMInstance}} \texorpdfstring{$\ast$}{*}pwm, float period)
\begin{DoxyCompactList}\small\item\em 设置pwm周期 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{bsp__pwm_8h_a4ad1e4350071eb83a7696aa52c586abf}{PWMStart\+DMA}} (\mbox{\hyperlink{structpwm__ins__temp}{PWMInstance}} \texorpdfstring{$\ast$}{*}pwm, uint32\+\_\+t \texorpdfstring{$\ast$}{*}p\+Data, uint32\+\_\+t Size)
\begin{DoxyCompactList}\small\item\em 启动pwm dma传输 \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\begin{DoxyAuthor}{Author}
your name (\href{mailto:you@domain.com}{\texttt{you@domain.\+com}}) 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}
0.\+1 
\end{DoxyVersion}
\begin{DoxyDate}{Date}
2023-\/02-\/14
\end{DoxyDate}
\begin{DoxyCopyright}{Copyright}
Copyright (c) 2023 
\end{DoxyCopyright}


\label{doc-func-members}
\Hypertarget{bsp__pwm_8h_doc-func-members}
\doxysubsection{Function Documentation}
\Hypertarget{bsp__pwm_8h_a2120d2df21cbc0f5ce613cc894656623}\index{bsp\_pwm.h@{bsp\_pwm.h}!PWMRegister@{PWMRegister}}
\index{PWMRegister@{PWMRegister}!bsp\_pwm.h@{bsp\_pwm.h}}
\doxysubsubsection{\texorpdfstring{PWMRegister()}{PWMRegister()}}
{\footnotesize\ttfamily \label{bsp__pwm_8h_a2120d2df21cbc0f5ce613cc894656623} 
\mbox{\hyperlink{structpwm__ins__temp}{PWMInstance}} \texorpdfstring{$\ast$}{*} PWMRegister (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_p_w_m___init___config__s}{PWM\+\_\+\+Init\+\_\+\+Config\+\_\+s}} \texorpdfstring{$\ast$}{*}}]{config}{}\end{DoxyParamCaption})}



注册一个pwm实例 


\begin{DoxyParams}{Parameters}
{\em config} & 初始化配置 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
PWMInstance\texorpdfstring{$\ast$}{*} 
\end{DoxyReturn}
\Hypertarget{bsp__pwm_8h_a1b6f35949a04703824318426cf726fe3}\index{bsp\_pwm.h@{bsp\_pwm.h}!PWMSetDutyRatio@{PWMSetDutyRatio}}
\index{PWMSetDutyRatio@{PWMSetDutyRatio}!bsp\_pwm.h@{bsp\_pwm.h}}
\doxysubsubsection{\texorpdfstring{PWMSetDutyRatio()}{PWMSetDutyRatio()}}
{\footnotesize\ttfamily \label{bsp__pwm_8h_a1b6f35949a04703824318426cf726fe3} 
void PWMSet\+Duty\+Ratio (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structpwm__ins__temp}{PWMInstance}} \texorpdfstring{$\ast$}{*}}]{pwm}{, }\item[{float}]{dutyratio}{}\end{DoxyParamCaption})}



设置pwm占空比 


\begin{DoxyParams}{Parameters}
{\em pwm} & pwm实例 \\
\hline
{\em dutyratio} & 占空比 0\texorpdfstring{$\sim$}{\string~}1 \\
\hline
\end{DoxyParams}
\Hypertarget{bsp__pwm_8h_a873e5ee427c6c73ce3c444daf26ac769}\index{bsp\_pwm.h@{bsp\_pwm.h}!PWMSetPeriod@{PWMSetPeriod}}
\index{PWMSetPeriod@{PWMSetPeriod}!bsp\_pwm.h@{bsp\_pwm.h}}
\doxysubsubsection{\texorpdfstring{PWMSetPeriod()}{PWMSetPeriod()}}
{\footnotesize\ttfamily \label{bsp__pwm_8h_a873e5ee427c6c73ce3c444daf26ac769} 
void PWMSet\+Period (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structpwm__ins__temp}{PWMInstance}} \texorpdfstring{$\ast$}{*}}]{pwm}{, }\item[{float}]{period}{}\end{DoxyParamCaption})}



设置pwm周期 


\begin{DoxyParams}{Parameters}
{\em pwm} & pwm实例 \\
\hline
{\em period} & 周期 单位 s \\
\hline
\end{DoxyParams}
\Hypertarget{bsp__pwm_8h_acd81680ae1e7064b568493eb50d0c6d2}\index{bsp\_pwm.h@{bsp\_pwm.h}!PWMStart@{PWMStart}}
\index{PWMStart@{PWMStart}!bsp\_pwm.h@{bsp\_pwm.h}}
\doxysubsubsection{\texorpdfstring{PWMStart()}{PWMStart()}}
{\footnotesize\ttfamily \label{bsp__pwm_8h_acd81680ae1e7064b568493eb50d0c6d2} 
void PWMStart (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structpwm__ins__temp}{PWMInstance}} \texorpdfstring{$\ast$}{*}}]{pwm}{}\end{DoxyParamCaption})}



启动pwm 


\begin{DoxyParams}{Parameters}
{\em pwm} & pwm实例 \\
\hline
\end{DoxyParams}
\Hypertarget{bsp__pwm_8h_a4ad1e4350071eb83a7696aa52c586abf}\index{bsp\_pwm.h@{bsp\_pwm.h}!PWMStartDMA@{PWMStartDMA}}
\index{PWMStartDMA@{PWMStartDMA}!bsp\_pwm.h@{bsp\_pwm.h}}
\doxysubsubsection{\texorpdfstring{PWMStartDMA()}{PWMStartDMA()}}
{\footnotesize\ttfamily \label{bsp__pwm_8h_a4ad1e4350071eb83a7696aa52c586abf} 
void PWMStart\+DMA (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structpwm__ins__temp}{PWMInstance}} \texorpdfstring{$\ast$}{*}}]{pwm}{, }\item[{uint32\+\_\+t \texorpdfstring{$\ast$}{*}}]{p\+Data}{, }\item[{uint32\+\_\+t}]{Size}{}\end{DoxyParamCaption})}



启动pwm dma传输 


\begin{DoxyParams}{Parameters}
{\em pwm} & pwm实例 \\
\hline
{\em p\+Data} & 数据首地址指针,注意数据的位数必须和\+Cube\+MX配置的\+DMA传输位数(字长)一致 \\
\hline
{\em Size} & 数据长度 \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
如果使用此函数,则需要在\+Cube\+MX中配置\+DMA传输位数为对应位数 例如\+:使用16位数据,则需要配置\+DMA传输位数为16位(half word),配置错误会导致指针越界或数据错误 
\end{DoxyNote}
\Hypertarget{bsp__pwm_8h_a0424e2983ba296a8acfa3a79bbad04a0}\index{bsp\_pwm.h@{bsp\_pwm.h}!PWMStop@{PWMStop}}
\index{PWMStop@{PWMStop}!bsp\_pwm.h@{bsp\_pwm.h}}
\doxysubsubsection{\texorpdfstring{PWMStop()}{PWMStop()}}
{\footnotesize\ttfamily \label{bsp__pwm_8h_a0424e2983ba296a8acfa3a79bbad04a0} 
void PWMStop (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structpwm__ins__temp}{PWMInstance}} \texorpdfstring{$\ast$}{*}}]{pwm}{}\end{DoxyParamCaption})}



停止pwm 


\begin{DoxyParams}{Parameters}
{\em pwm} & pwm实例 \\
\hline
\end{DoxyParams}
